$(function() {
    
    $('#login').on('click', function() {
        var dialog =
        '<div id="login-box" class="modal hide fade">'+
        '<div class="modal-body">'+
        '<p>One fine body…</p>'+
        '</div>'+
        '<div class="modal-footer">'+
        '<button class="btn" data-dismiss="modal" aria-hidden="true">Cancelar</button>'+
        '<a href="#" class="btn">Ingresar</a>'+
        '</div>'+
        '</div>'
        $('body').append(dialog);
        
        $.get(
            '/login',
            function(data) {
                $('#login-box .modal-body').html(data);
                $('#login-box').modal();
            }, 'html');
    });
    
});